package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.system.domain.FootReward;
import org.footballmanager.pandafootball.system.form.SearchForm;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;

@Getter
@Setter
public class FootRewardSearchForm extends SearchForm implements Serializable {
    private static final long serialVersionUID = 8090668615941861522L;
    protected Integer totalTimes;
    protected String name;
    protected Long userId;

    public Example buildSearchCommond() {
        Example example = new Example(FootReward.class);
        Example.Criteria criteria = example.createCriteria();
        if (null != totalTimes) {
            criteria.andEqualTo("totalTimes", totalTimes);
        }
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("createTime").desc();
        return example;
    }

}
